package pl.edu.agh.xls2html.htmlelements;

import static org.junit.Assert.assertEquals;

import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.junit.Before;
import org.junit.Test;

public class DocumentTest {

	private HSSFWorkbook wb;
	private HSSFSheet sheet;
	private HSSFRow row;

	private Document doc;
	private Table testTable;

	@Before
	public void setUp() throws Exception {
		wb = new HSSFWorkbook();
		sheet = wb.createSheet();
		row = sheet.createRow(0);
		row.createCell(0);
		// cell2 = row.createCell(1);
		doc = new Document(wb);

		testTable = new Table(sheet, wb, doc);
	}

	@Test
	public void testGetSheetsNumber() {

		assertEquals(1, doc.getSheetsNumber());
	}

	@Test
	public void testIsStaticMode() {
		assertEquals(false, doc.isStaticMode());
		doc.setStaticMode();
		assertEquals(true, doc.isStaticMode());
	}

	@Test
	public void testGetSheetCSS() {
		assertEquals(testTable.getCSS(), doc.getSheetCSS(0));
	}

}
